package marketing

import (
	"jlpay-sdk-go/pkg/jlpay/core"
	"jlpay-sdk-go/pkg/jlpay/models/marketing"
	"jlpay-sdk-go/pkg/jlpay/services"
)

// MerchantActivityAddService 商户活动新增服务
type MerchantActivityAddService struct {
	*services.BaseService
}

// NewMerchantActivityAddService 创建新的商户活动新增服务
func NewMerchantActivityAddService(config *core.Config) *MerchantActivityAddService {
	return &MerchantActivityAddService{
		BaseService: services.NewBaseService(config),
	}
}

// MerchantActivityAdd 商户活动新增接口
func (s *MerchantActivityAddService) MerchantActivityAdd(request *marketing.MerchantActivityAddRequest) (*marketing.MerchantActivityAddResponse, error) {
	response := marketing.NewMerchantActivityAddResponse()

	// 获取API路径
	apiPath := request.Path()

	// 发送POST请求
	err := s.Post(request, response, apiPath)
	if err != nil {
		return nil, err
	}

	return response, nil
}
